package cn.gov.msa.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import cn.gov.msa.dao.SuperInspecRecordMapper;
import cn.gov.msa.model.SuperInspecRecord;
import cn.gov.msa.pagehelper.CustomPageHelper;
import cn.gov.msa.service.SuperInspecRecordService;

public class SuperInspecRecordServiceImpl implements SuperInspecRecordService {

	@Autowired
	SuperInspecRecordMapper superInspecRecordMapper;
	
	@Override
	public int insertSelective(SuperInspecRecord record) {
		return superInspecRecordMapper.insertSelective(record);
	}

	@Override
	public List<SuperInspecRecord> selectData(int pageNum, int pageSize, SuperInspecRecord record) {
		CustomPageHelper.startPage(pageNum, pageSize); // 核心分页代码
		return superInspecRecordMapper.selectData(record);
	}

	@Override
	public int updateByUniqueId(SuperInspecRecord record) {
		if(null != record.getSuperinspecrecordid()){
			return superInspecRecordMapper.updateByPrimaryKeySelective(record);
		} else {
			return superInspecRecordMapper.updateByApplyid(record);
		}
		
	}

	@Override
	public int deleteByPrimaryKey(String superinspecrecordid) {
		return superInspecRecordMapper.deleteByPrimaryKey(superinspecrecordid);
	}

}
